/*
* 生产api
* */

import 'package:center_beijing/common/http_util.dart';


//根据构件ID查询生产记录
getCompHistory(compId) async {
  var responseJson = await HttpUtil().get("rheaservice/api/componentWater/"+compId);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 提交生产工序表单
* */
subWorkStageForm(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/componentWaterWorkstage",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 提交异常状态表单
* */
subAbnormal(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/componentWaterState",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//查询已完成工序详情(工序状态)
getCompleteWorkStageDetail(compId) async {
  var responseJson = await HttpUtil().get("rheaservice/api/componentWaterWorkstage/"+compId);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//查询已完成工序详情(异常状态)
getAbnormalWorkStageDetail(compId) async {
  var responseJson = await HttpUtil().get("rheaservice/api/componentWaterState/"+compId);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 补录异常状态
* */
appendAbnormal(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/componentWaterState/appendAttachment",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 补录工序状态
* */
appendWorkStage(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/componentWaterWorkstage/appendAttachment",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}



/*
* 上传文件
* */
uploadImage(params,tenId) async {
  var responseJson = await HttpUtil().post("rheaservice/api/attachments/upload/batch/"+tenId,params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 堆场管理提交
* */
subStorage(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/warehouse/addCompToWarehouse",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

/*
* 运输管理提交
* */
transport(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/transport",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//获取所有订单
getOrderList(params) async {
  var responseJson = await HttpUtil().get("rheaservice/api/orderInfo/list",params:params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//获取车辆列表
getAllCars(params) async {
  var responseJson = await HttpUtil().get("rheaservice/api/transportcar/list",params:params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//获取日排产任务列表
getProjectTasks(projectId) async {
  var responseJson = await HttpUtil().get("rheaservice/api/planday/project/"+projectId);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//获取任务构件列表
getTasksList(params) async {
  var responseJson = await HttpUtil().get("rheaservice/api/planday/getCompPagination",params:params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

//获取BOM清单
getBOMList(params) async {
  var responseJson = await HttpUtil().get("rheaservice/api/orderBom/pagination",params:params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

// 查询实际配合比表单
getMixProportionList(params) async {
  var responseJson = await HttpUtil().get("rheaservice/api/mixProportion/detail/list",params:params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

// 提交实际配合比表单
addMixProportion(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/mixProportion/real",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}


// 设置实际方量
addConcreteUsage(params) async {
  var responseJson = await HttpUtil().post("rheaservice/api/orderCompInfo/updateConcreteUsage",params);
  if(responseJson!=null){
    return responseJson;
  }else{
    return null;
  }
}

